<?php
namespace Common\Common;

use Think\Controller;

class GetsonController extends Controller
{
   public  function getsons($cid, $data){
         static $arr = [];
         foreach ($data as $k => $v) {
            if ($cid == $v['sid']) {
               $arr[] = $v['cid'];
               $this->getsons($v['cid'], $data);
            }
         }
         return $arr;
   }

}